# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=gnome-flashback
pkgver=3.46.0
pkgrel=1
pkgdesc='GNOME Flashback session'
arch=('loong64' 'x86_64')
url='https://wiki.gnome.org/Projects/GnomeFlashback'
license=('GPL')
depends=('gnome-bluetooth-3.0' 'gnome-panel' 'gnome-session' 'gnome-settings-daemon'
         'gnome-themes-extra' 'libibus' 'libxkbfile' 'metacity' 'libcanberra')
makedepends=('python3')
optdepends=('gnome-backgrounds: Default background'
            'gnome-control-center: System settings'
            'network-manager-applet: Network management')
options=('debug')
source=("https://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz"
        'gnome-flashback.pam')
sha256sums=('7a8d5c03310e4dfadd18a65e00a37741032afeea5418dd6804a975c4b0980045'
            '7148b3b1773fa312d6cd14798338cc70cffb6df7504ff1787687edd0363138d2')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/$pkgname \
              --disable-schemas-compile --enable-compile-warnings=minimum
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  # Install pam file for the screensaver
  install -Dm644 ../gnome-flashback.pam "$pkgdir/etc/pam.d/gnome-flashback"
}
